﻿using HandyControl.Tools;
using System;
using System.Globalization;
using System.Windows.Data;

namespace LpbPrj.Client.Tools.Converter
{
    public class RadioButtonBackgroundConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var output = ResourceHelper.GetResource<System.Windows.Media.Brush>("BackgroundBrush");
            if (value == null) return output;

            {
                if (value is bool input && input == true)
                {
                    output = ResourceHelper.GetResource<System.Windows.Media.Brush>("ThirdlyRegionBrush");
                }
            }

            return output;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return 0;
        }
    }

    public class RadioButtonBorderConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var output = ResourceHelper.GetResource<System.Windows.Media.Brush>("BorderBrush");
            if (value == null) return output;

            {
                if (value is bool input && input == true)
                {
                    output = ResourceHelper.GetResource<System.Windows.Media.Brush>("SelectedHighlightBorderBrush");
                }
            }

            return output;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return 0;
        }
    }

}
